<include file="Public:header" />
<include file="Public:leftside" />
<style>
    html, body {height: 100%;margin: 0;padding: 0;position: relative;}
    .mask_box a {display: block;text-align: center;text-decoration: none;color: #fff;cursor: pointer;}
    .mask_box {position: absolute; height: 100%; width: 100%;background: rgba(0,0,0,0.2);padding-top: 200px;box-sizing: border-box;display: none;}
    .inside_box {background-color: #fff;width: 300px;margin: 0 auto;text-align: center;border: 1px #787878 solid;border-radius: 4px;padding: 15px 0;}
    .inside_box p:nth-child(1) { border-bottom: 1px #cdcdcd solid;padding-bottom: 10px;height: 30px;line-height: 30px;}
    .text_content{width: 300px;} 
    .text_content a{width: 200px; height: 30px; margin: 0 auto; line-height: 30px; border-radius: 4px; margin: 15px auto;} 
    .text_content a:nth-child(1){background: #cdcdcd; margin-top: 26px;} 
    .text_content a:nth-child(2){background: #cdcdcd; color: #333;} 
    .text_content input:nth-child(6){display: inline-block; background: #ddd; color: #fff; width: 80px; margin-right: 20px; border: none; padding: 5px 0;} 
    .text_content input:nth-child(7){padding: 5px 0; display: inline-block; background: #666666; color: #fff; width: 80px; border: none;} 
    #textarea1{width: 180px; height: 80px; display: none; margin: 10px auto;}
    #sample-table-1 tbody tr td div{padding: 5px 0;} 
    .font_orange.font_bold{padding-right: 15px;} 
    @media screen and (min-width:10px) and (max-width:600px){.font_orange.font_bold{padding-right: 10px; font-size: 12px;} }
    #colls{padding-top: 5px;}
</style>

<div class="main-content">
    <div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
        <ul class="breadcrumb">
            <li><i class="icon-home home-icon"></i><a href="/">首页</a> </li>
            <li class="active">本地商家管理</li>
        </ul>
    </div>
    <div class="page-content">
        <div class="listContent">
           

        <form action="{:U('OfferList/index')}" method="get" class="form-inline">
          <section class="panel-default m-b-sm" style="margin:5px 0;">
                <div class="alert alert-info">
                    <p>
                      <i class="fa fa-hand-o-right m-r-xs"></i><strong>操作提示</strong>
                    </p>
                      <p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>该页面展示了商城所有的本地商家信息，可对本地商家进行编辑修改操作。</p>
                      <p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>可输入本地商家名称关键字进行搜索。</p>
                </div>
          </section>

          <div class="row padder-v" >
              <div class="col-sm-2">
                <a href="{:U('OfferList/offerAdd')}" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i> 添加店铺 </a>
              </div>
              <div class="col-sm-2">
                商家名称：
                <input type="text" name="nickname" value="{$_GET['nickname']}" class="form-control input-sm" placeholder="请输入商家名称" style="width: 60%"/>
   
              </div>
              <div class="col-sm-2">
                手机号：
                <input type="text" name="phone" value="{$_GET['phone']}" class="form-control input-sm" placeholder="请输入手机号" style="width: 60%"/>
              </div>
             
              <div class="col-sm-2">
                审核状态：<select name ="hasCheck">
                              <option value="" <?=I('get.hasCheck') === ''?'selected':''?>>全部</option>
                              <option value="1" <?=I('get.hasCheck') === '1'?'selected':''?>>未审核</option>
                              <option value="2" <?=I('get.hasCheck') === '2'?'selected':''?>>审核通过</option>
                              <option value="3" <?=I('get.hasCheck') === '3'?'selected':''?>>审核未通过</option>
                          </select>
              </div>
              <div class="col-sm-2">
              排序方式:  <select name="orderBy">
                            <option value="" <?=I('get.orderBy') === ''?'selected':''?>>ID降序</option>
                            <option value="1" <?=I('get.orderBy') === '1'?'selected':''?>>ID升序</option>
                            <option value="2" <?=I('get.orderBy') === '2'?'selected':''?>>余额降序</option>
                            <option value="3" <?=I('get.orderBy') === '3'?'selected':''?>>余额升序</option>
                        </select>
              </div>
              <div class="col-sm-2">
               <input type="submit" class="btn btn-primary btn-sm" value="搜索"/> 商家总数：{$offerCount}
                
              </div>
            </div>
      </div>
        </form>
    
        
        <table class="table table-striped table-bordered table-hover"  border="0" cellpadding="0" cellspacing="0" >
          <thead>
            <tr class="title">
              <th style="width: 40px;">ID</th>
              <th style="width: 200px;">商家名称</th>
              <th style="width: 160px;">电话</th>
              <th style="width: 260px;">地址</th>
              <th style="width: 100px;">佣金余额</th>
              <th style="width: 100px;">是否审核</th>
              <th style="width: 100px;">绑定会员ID</th>
              <th style="width: 150px;">操作</th>
            </tr>
          </thead>
          <tbody>
            <volist name="arrayFlag" id="row">
              <tr class="list" id="list{$row['id']}">
                <td>{$row['id']}</td>
                <td style="font-weight:bold;"><a href="__CONTROLLER__/offerlist_order/id/{$row['id']}">{$row['name']}</a></td>
                <td>{$row.phone}</td>
                <td>{$row.address}</td>
                <td>{$row.tmoney}</td>
                <td><if condition="$row.hasCheck eq '1'">审核通过<else/><if condition="$row.hasCheck eq '2'">审核未通过<else/>未审核</if></if></td>
                <td>{$row.addtime|date="Y-m-d H:i:s",###}</td>
                <td>
                  <if condition="$row.hasCheck neq '1'">
                      <a ajax="1"  class="btn btn-success btn-xs" needConfirm="1" content="确定要审核吗dd" url="__CONTROLLER__/offerChange/id/{$row.id}/hasCheck/1" data-offerid ="{$row.id}" >审核</a>&nbsp;
                  </if>
                  <a href="__CONTROLLER__/offerAdd/id/{$row['id']}">修改</a>&nbsp;
                  <a href="javascript:;" url="__CONTROLLER__/offerDelete/id/{$row['id']}/ishidden/<?PHP echo $row['ishidden'] == 0?'1':'0'; ?>" ajax="1" class="aclick" needconfirm="1" content="确定禁用吗?"><?PHP echo $row['ishidden'] == 0?'禁用':'启用'; ?></a>&nbsp;&nbsp; 
                </td>
              </tr>
            </volist>
          </tbody>
        </table>

            <div class="page">{$page}</div>
        </div>
    </div>
</div>


<script type="text/javascript">
    $(".btn-xs").click(function (event) {
      var Top=$(document).scrollTop();
      var Top_t=Top+200;
      $(".mask_box").css('padding-top', Top_t);
        $(document.body).css({
               "overflow-x":"hidden",
               "overflow-y":"hidden"
             });
        
        var kkk = $(this).data("offerid");
        $(".mask_box").fadeIn('slow', function () {
          $("#offerid_yyk").attr("value", kkk);
        });
        $("#pass").click(function (event) {
            $(this).css('background-color', '#2d8ded');
            $("#nopass").css('background-color', '#cdcdcd');
            $("#checknum").attr('value', '1');
            $("#textarea1").css('display', 'none');
          

        });
        $("#nopass").click(function (event) {
            $(this).css({
                'background-color': '#2d8ded',
                'color': '#fff'
            });

            $("#pass").css('background-color', '#cdcdcd');
            $("#checknum").attr('value', '2');
            $("#textarea1").css('display', 'block');
        });
        $("#cencel").click(function (event) {
            $(".mask_box").css('display', 'none');
            $("#pass").attr('value', '0').css('background-color', '#cdcdcd');
            $("#nopass").attr('value', '0').css('background-color', '#cdcdcd');
            $("#textarea1").css('display', 'none');
            $(document.body).css({
                 "overflow-x":"auto",
                 "overflow-y":"auto"
               });
        });
    });
</script>
<include file="Public:footer" />
